package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.entity.CmsUser;
import com.project.pojo.dto.UserDTO;
import com.project.pojo.model.UserQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
@Mapper
public interface CmsUserMapper extends BaseMapper<CmsUser> {

    /**
     * 按条件分页查询用户及上级信息
     * @param page
     * @param userQuery
     * @return
     */
    IPage<UserDTO> selectUserByQuery(Page<UserDTO> page, @Param("userQuery") UserQuery userQuery);

    /**
     * 按条件查询用户,返回集合
     * @param userQuery
     * @return
     */
    List<UserDTO> selectUserByQuery(@Param("userQuery") UserQuery userQuery);

    /**
     * 今日注册人数
     * @return
     */
    int selectDayRegisterNumber(@Param("selectDate")Date selectDate);

    /**
     * 总注册人数,整个系统截止目前总注册人数数量（不包含测试账户）
     * @return
     */
    int selectTotalPeopleNum();

}